* image.el (image-type-from-buffer): Only return supported image type.
authorChong Yidong <cyd@gnu.org>
Thu, 26 Apr 2012 08:43:20 +0000 (16:43 +0800)
committerChong Yidong <cyd@gnu.org>
Thu, 26 Apr 2012 08:43:20 +0000 (16:43 +0800)
lisp/ChangeLog
lisp/image.el

index 61918d64e514e29023429c9ec1dc3859658730ea..ad4a4df22ebb69548366284ac8ce10a254bdea65 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-26  Chong Yidong  <cyd@gnu.org>
 
+       * image.el (image-type-from-buffer): Only return supported image
+       type (Bug#9045).
+
        * vc/diff-mode.el (diff-beginning-of-hunk): Return a meaningful
        value, for symmetry with diff-end-of-hunk.
        (diff-split-hunk, diff-find-source-location)
index 348c208781e601e3a7e227962a16b4b19c0457e7..27e41a57efec308a3e6e2b156b2006da6747a415 100644 (file)
@@ -282,7 +282,9 @@ be determined."
                  types nil)
          (setq types (cdr types)))))
     (goto-char opoint)
-    type))
+    (and type
+        (memq type image-types)
+        type)))
 
 
 ;;;###autoload